package com.demo.model.service.validations;

public class StringLengthException extends Exception{
    private static final long serialVersionUID = -703258506939748930L;
    
    public StringLengthException(String tipo, int minimo, int maximo) {
        super(buildError(tipo, minimo, maximo));
    }
    
    private static String buildError(String tipo, int minimo, int maximo) {
        return "La longitud de " + tipo + "es minimo " + minimo + " y maximo " + maximo + " caracteres.";
    }

}
